package cn.meye11.crm.domain.entity;

import cn.meye11.crm.domain.model.Cost;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;
import tk.mybatis.mapper.annotation.KeySql;
import tk.mybatis.mapper.annotation.LogicDelete;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * (Cost)类
 *
 * @author makejava
 * @since 2024-01-03 14:41:34
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = CostEntity.Table)
public class CostEntity implements Serializable {

    public static final String Table = "t_cost";
    private static final long serialVersionUID = -62924998733783164L;
    
    public CostEntity(Cost model) {
        BeanUtils.copyProperties(model, this);
    }

    @Id
    @KeySql(useGeneratedKeys = true)
    @Column(insertable = false)
    private Long id;
    /* 成本年月 */
    private String yearmonth;
    /* 成本项目 */
    private String name;
    /* 成本价 */
    private Double costPrice;
    /* 操作人姓名 */
    private String operators;
    /* 标签 */
    private String label;
    /* 是否删除 */
    @LogicDelete
    private Integer del;
    /* 最后修改时间 */
    private LocalDateTime last;
    /* 创建时间 */
    private LocalDateTime time;
    /* 创建人 */
    private String createdBy;
    /* 最后修改人 */
    private String modifiedBy;
    /* 版本 */
    private Integer version;

}
